<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" href="/Public/Admin/css/personal.css"/>
    <style>
        @font-face {
            font-family: 'iconfont';  /* project id 645562 */
            src: url('//at.alicdn.com/t/font_645562_i6k1q02gdl6m9529.eot');
            src: url('//at.alicdn.com/t/font_645562_i6k1q02gdl6m9529.eot?#iefix') format('embedded-opentype'),
                url('//at.alicdn.com/t/font_645562_i6k1q02gdl6m9529.woff') format('woff'),
                url('//at.alicdn.com/t/font_645562_i6k1q02gdl6m9529.ttf') format('truetype'),
                url('//at.alicdn.com/t/font_645562_i6k1q02gdl6m9529.svg#iconfont') format('svg');
        }

        .plan_nr{margin-left:5px}
        .plan_nr{position: relative}
        .readFlag{width:6px;height:6px;border-radius: 50%;background: #F74339;display: inline-block;position: absolute;top:17px;left:6px}
        .page .next, .prev, .first{color:#333;}
        .page .current,.page .next:hover,.page .num:hover{border:1px solid #2299ee;}
        .page .num,.current{margin-left:4px;}
        .prev{margin-right: -3px;}
        #page{padding-top: 10px;}
        .width8{width: 8%}
    </style>
</block>
<block name="content" > 
    <section class="layui-larry-box">
        <div class="larry-personal">
            <div class="layui-tab">
                <blockquote class="layui-elem-quote news_search">
                    <form method="get">
                        <div class="layui-inline width8">
                            <span class="btn-upload form-group">
                                <!--<a class="btn btn-primary search" data-url="{:U('index')}"><i class="Hui-iconfont">&#xe67a;</i> 计划类型</a>-->
                                <select name="pType" class="layui-input search_input">
                                    <option value="">按类型</option>
                                    <foreach name="planType" item="type">
                                        <option value="{$type.type_id}" {$pType == $type['type_id'] ? 'selected' : ''}>{$type.type_name}</option>
                                    </foreach>
                                </select>
                            </span>
                        </div>
                        <div class="layui-inline width8">
                            <span class="btn-upload form-group">
                                <!--<a class="btn btn-primary search" data-url="{:U('index')}"><i class="Hui-iconfont">&#xe67a;</i> 计划类型</a>-->
                                <select name="child_type" class="layui-input search_input">
                                    <option value="">按标记</option>
                                    <foreach name="planFlag" item="flag">
                                        <option value="{$flag.type_id}" {$pFlag == $flag['type_id'] ? 'selected' : ''}>{$flag.type_name}</option>
                                    </foreach>
                                </select>
                            </span>
                        </div>
                        <notempty name="depts">
                            <div class="layui-inline width8">
                                <span class="btn-upload form-group">
                                    <!--<a class="btn btn-primary search" data-url="{:U('index')}"><i class="Hui-iconfont">&#xe67a;</i>部门</a>-->
                                    <select name="to_id" class="layui-input search_input">
                                        <option value="">按部门</option>
                                        <foreach name="depts" item="dept">
                                            <option value="{$dept.dept_id}" {$deptName == $dept['dept_id'] ? 'selected' : ''}>{$dept.dept_name}</option>
                                        </foreach>
                                    </select>
                                </span>
                            </div>
                        </notempty>
                        <div class="layui-inline width8">
                            <span class="btn-upload form-group">
                                <!--<a class="btn btn-primary search" data-url="{:U('index')}"><i class="Hui-iconfont">&#xe67a;</i>等级</a>-->
                                <select name="level" class="layui-input search_input">
                                    <option value="">按等级</option>
                                    <option value="1" {$level == 1 ? 'selected' : ''}>个人级</option>
                                    <option value="2" {$level == 2 ? 'selected' : ''}>部门级</option>
                                </select>
                            </span>
                        </div>
                        <div class="layui-inline width8">
                            <span class="btn-upload form-group">
                                <!--<a class="btn btn-primary search" data-url="{:U('index')}"><i class="Hui-iconfont">&#xe67a;</i>等级</a>-->
                                <select name="sms_flag" class="layui-input search_input">
                                    <option value="">按状态</option>
                                    <option value="0" {$smsFlag == 0 ? 'selected' : ''}>进行中</option>
                                    <option value="1" {$smsFlag == 1 ? 'selected' : ''}>已结束</option>
                                </select>
                            </span>
                        </div>
                        <div class="layui-input-inline" style="width:10%">
                            <input type="text" name="plan_name" placeholder="计划标题" value="{$planName}" class="layui-input search_input">
                        </div>
                        <div class="layui-input-inline" style="width:40%">
                            <input type="text" name="start" placeholder="开始时间" value="{$start}" class="layui-input search_input datepickerInput" style="width:25%;display:inline-block"> &nbsp;至&nbsp; <input type="text" name="end" placeholder="结束时间" value="{$end}" class="layui-input search_input datepickerInput" style="width:25%;display:inline-block">
                            <a class="layui-btn search_btn search" data-url="{:U('index')}" style="margin-left:10px;"> 查询</a>
                        </div>
                        <!--加条件时，type=0-->
                        <input type='hidden' name='type' value='0'>
                        <input type="hidden" name="p" value="1" />
                    </form>
                </blockquote>
                <div class="layui-block" style="text-align:right;margin-top:8px;margin-bottom:8px;">
                    <a class="layui-btn search_btn" href="{:U('save')}" style="font-size:14px;"> 新建计划</a>
                </div>
                <div class="layui-tab-content larry-personal-body clearfix mylog-info-box">
                    <!-- 计划列表 -->
                    <div class="layui-tab-item layui-field-box layui-show">
                        <table class="layui-table table-hover" lay-even="" lay-skin="nob">
                            <thead>
                                <tr>
                                    <!--<th><input type="checkbox" id="selected-all"></th>-->
                                    <th>序号</th>
                                    <th>标题</th>
                                    <!--                                    <th>类型</th>
                                                                        <th>等级</th>-->
                                    <!--                            <if condition="$isLeader eq true">
                                                                    <th>部门</th>
                                                                </if>-->
                                    <th width="12%">开始时间</th>
                                    <th width="12%">负责人/执行人</th>
                                    <!--<th>创建人</th>-->
                                    <!--<th>状态</th>-->
                                    <th width="7%">总进度</th>
                                    <th width="7%">标的物</th>
                                    <th width="6%">关注</th>
                            <if condition="$isLeader eq 1">
                                <th width="6%">提醒</th>
                            </if>
                            <th width="10%">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <notempty name="data">
                                <foreach name="data" item="row" key="key">
                                    <tr>
                                        <!--<td><input type="checkbox"></td>-->
                                        <td class="plan_nr">
                                    <if condition="$row['noRead'] == 1">
                                        <span class="readFlag"></span>
                                    </if>
                                    {$row.num}
                                    </td>
                                    <td><a href="{:U('show',array('id'=>$row['plan_id'],'type'=>$condition,'pType'=>$pType,'level'=>$level,'sms_flag'=>$row['sms_flag'],'plan_name'=>$planName,'start'=>$start,'end'=>$end,'to_id'=>$deptName))}" title="{$row.fullName}">{$row.name}</a></td>
                                    <!--                                        <td>{$row.type|getPlanType}<if condition="$row['child_type'] neq null">（{$row.child_type}） </if></td>
                                                                        <td><if condition="$row['level'] eq 1">个人级<elseif condition="$row['level'] eq 2" />部门级<else />未选择等级</if></td>-->
                                    <!--                                    <if condition="$isLeader eq true">
                                                                            <td><if condition="$deptName neq null">{$deptName|getDeptName}</if></td>
                                                                        </if>-->
                                    <td>{$row.begin_date}</td>
                                    <td><if condition="$row['executor'] neq null">{$row.executor|getMoreUsername}<else/>{$row.manager}</if></td>
                                    <!--                                    <td>{$row.creator|getChineseName}</td>
                                                                        <td>{$row['sms_flag'] ? '已结束' : '进行中'}</td>-->
                                    <td>{$row.total_percent}%</td>
                                    <td>{$row['uploads_url']? '有' :'无'}</td>
                                    <td>
                                        <a class="ml-5 pointer follow" data-id="{$row.plan_id}" title="{$row['follow'] ? '取消关注' : '关注'}">
                                            <if condition="$row['follow'] eq 1">
                                                <img src="/Public/Admin/images/gz1.png">
                                                <else />
                                                <img src="/Public/Admin/images/gz2.png">
                                            </if>
                                        </a>
                                    </td>
                                    <if condition="$isLeader eq 1">
                                        <td>
                                        <if condition="$row['remind'] eq null">
                                            <a class="ml-5 remind pointer" data-url="{:U('remind',array('id'=>$row['plan_id']))}" title="发送提醒"><img src="/Public/Admin/images/no_remind.png"></a> 
                                            <else />
                                            <a class="ml-5 remind pointer" data-url="{:U('remind',array('id'=>$row['plan_id']))}" title="上次提醒时间：{$row.remind}"><img src="/Public/Admin/images/remind.png"></a> 
                                        </if>
                                        </td>
                                    </if>
                                    <td>
                                        <a style="text-decoration:none;display:inline-block;width:20px;" href="/index.php/Home/Plan/save?id={$row.plan_id}&type={$row.type}&pType={$pType}&deptName={$deptName}&level={$level}&smsFlag={$smsFlag}&planName={$planName}&start={$start}&end={$end}&p={$p}" title="编辑"><i class="iconfont icon-xiugai" style="font-size:15px;"> </i></a> 
                                        <div style="display:inline-block;width:20px;">
                                            <if condition="$row[is_manager] eq 1">
                                                <if condition="$row[sms_flag] eq 0">
                                                    <a style="text-decoration:none;" class="ml-5 theend" data-type="1" data-url="{:U('theend',array('id'=>$row['plan_id'],'type'=>1))}"  title="强制结束">
                                                        <i class="iconfont pointer" style="font-size:20px;position: relative;top:2px;">&#xe6fe;</i>
                                                    </a>
                                                    <else/>
                                                    <a style="text-decoration:none;" class="ml-5 theend" data-type="0" data-url="{:U('theend',array('id'=>$row['plan_id'],'type'=>0))}"  title="强制开始">
                                                        <i class="iconfont pointer" style="font-size:20px;position: relative;top:2px;">&#xe6b8;</i>
                                                    </a>
                                                </if>
                                            </if>
                                        </div>
                                        <div style="display:inline-block;width:20px;">
                                            <if condition="$row[is_creator] eq 1">
                                                <a style="text-decoration:none;display:inline-block;width:20px;" class="ml-5 delete" data-url="{:U('delete',array('id'=>$row['plan_id']))}"  title="删除"><i class="iconfont icon-shanchu3" style="color:#666;font-size:15px;"></i></a>
                                            </if>
                                        </div>
                                    </td>
                                    </tr>
                                </foreach>
                                <else/>
                                <tr><td colspan="8" style="border-bottom: 1px solid #fff;border-left: 1px solid #fff;text-align: left">暂无数据</td></tr>
                            </notempty>
                            </tbody>
                        </table>
                        <div class="layui-block">共{$count}条数据</div>
                        <div class="larry-table-page clearfix">
                            <input type='hidden' id="followUrl" value="{:U('attentPlan')}">
                            <!--<a href="javascript:;" class="layui-btn layui-btn-small"><i class="iconfont icon-shanchu1"></i>删除</a>-->
                            <div id="page" class="page">{$page}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Admin/js/plan.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js" ></script>
    <script type="text/javascript">
        $(dateTime(0));
        $(initPlanIndex());


    </script>    
</block>

